<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img {
            vertical-align: top;
        }

        div {
            width: 300px;
            height: 100px;
            background-color: #ddd;
            line-height: 100px;
            text-align: center;
        }

        img {
            vertical-align: middle;
        }


        
    </style>
</head>

<body>


    vertical-align 只有行内块级元素可以使用


    <div>
        <img src="../images/1.jpg" alt="">
    </div>

    <!-- <div>呵呵</div> -->

</body>

</html>